//
//  GWDetailStatuseFrame.m
//  新浪微博
//
//  Created by qianfeng on 16/2/18.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWDetailStatuseFrame.h"
#import "GWStatuseModel.h"
#import "GWOriginalStatuseFrame.h"
#import "GWReportStatuseFrame.h"
@implementation GWDetailStatuseFrame

-(void)setStatuse:(GWStatuseModel *)statuse
{
    _statuse =statuse;
    //1.计算原微博的frame
    self.originalStatuseFrame =[[GWOriginalStatuseFrame alloc]init];
    self.originalStatuseFrame.statuse =self.statuse;
    
    //2.计算转发微博的frame
    CGFloat h =0;
    if (statuse.retweeted_status) {
        self.reportStatuseFrame =[[GWReportStatuseFrame alloc]init];
        self.reportStatuseFrame.statuse =self.statuse.retweeted_status;
        CGRect f =self.reportStatuseFrame.frame;
        f.origin.y =CGRectGetMaxY(self.originalStatuseFrame.frame);
        self.reportStatuseFrame.frame =f;
        h=CGRectGetMaxY(self.reportStatuseFrame.frame);
    }
    else
    {
        h=CGRectGetMaxY(self.originalStatuseFrame.frame);
    }
    
    self.frame =CGRectMake(0, 10, GWScreenW, h);
}

@end
